package com.liuym.classes.repository.mapper;

import com.liuym.classes.repository.model.bo.ClassScoreBatchBO;
import com.liuym.classes.repository.model.entity.Classes;
import com.liuym.common.exception.ClassException;

import java.util.List;
import java.util.Map;

public interface ClassesMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Classes record);

    int insertSelective(Classes record);

    Classes selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Classes record);

    int updateByPrimaryKey(Classes record);

    /**
     * 获得所有班级
     *
     * @return
     */
    List<Classes> getAllClass();

    /**
     * 根据班号获得班级信息
     *
     * @param classNumber
     * @return
     */
    Classes getClassByNumber(long classNumber);

    /**
     * 获得所有年级
     *
     * @return
     */
    List<Integer> getAllYear();

    /**
     * 删除班级
     *
     * @param classNumber
     */
    void deleteClass(long classNumber);

    /**
     * 获得班号列表
     *
     * @return
     */
    List<Long> findClassNumberList();

    void addClassList(List<Classes> list);

    int updateScoreByClassNumber(Map<String, Object> map);

    /**
     * 批量更新班级分数
     *
     * @param classScoreBatchBOList
     * @return
     * @throws ClassException
     */
    int updateScoreByClassNumberBatch(List<ClassScoreBatchBO> classScoreBatchBOList) throws ClassException;

    int updateClassScoreTo80();

    List<Classes> getClassByYear(int year);
}